package com.danco.sn.entities;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.danco.sn.apientities.IFriend;
import com.danco.sn.apientities.IUser;

@Entity
@Table(name="friends_table")
public class Friend implements IFriend {	
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "id")	
	private Integer id;

	
	@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY, targetEntity = User.class)
	@JoinColumn(name="id_user")
	private IUser currentUser;
	
	@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY, targetEntity = User.class)
	@JoinColumn(name="id_friend")
	private IUser friend;
	
	@Column(name="friendship_status")
	private String status;

	public IUser getCurrentUser() {
		return currentUser;
	}

	public void setCurrentUser(IUser currentUser) {
		this.currentUser = currentUser;
	}

	public IUser getFriend() {
		return friend;
	}

	public void setFriend(IUser friend) {
		this.friend = friend;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	
	
}
